#define PrynInternal
#define PrynImplementation
#include <pryn.h>

PrynExport (PrynResult, prynResultSourceName, (PrynResult value, PrynString *output))
{
	PrynStartFunction ();

	if (output) prynStringNull (output);

	switch (prynResultSource (value))
	{
	#define caseEasy(NAME) case PrynResultSource##NAME: prynStringLiteral (output, #NAME); return 0;
		caseEasy (General);
		caseEasy (Change);
		caseEasy (Component);
		caseEasy (Factory);
		caseEasy (Library);
		caseEasy (Mediator);
		caseEasy (Monitor);
		caseEasy (Object);
		caseEasy (Pin);
		caseEasy (State);
		caseEasy (Stream);
		caseEasy (String);
		caseEasy (Tag);
		caseEasy (Type);
		caseEasy (Value);
	#undef caseEasy
	}

	PrynEndFunction ();
}